# -*- coding: utf-8 -*-
# 自动刷行 浏览器进行 页面请求
# python 2.7 test
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time


def refleshff():
    
    #no headless open firefox
    
    firefox_option=Options()
    # firefox_option.add_argument('--headless')

    browser=webdriver.Firefox(firefox_options=firefox_option)
    
    browser.get('http://xxxx.com')

    try:
       while True :
  
         # 刷新
         browser.refresh()
         print("------------------------------")
         localtime = time.localtime(time.time())
         print "now time ", localtime
   
         time.sleep(1)

    finally:
        browser.quit()
        print("close browser ")



while True :
    refleshff()
    print(" error  run ，to run next ")
    print("++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")





